package com.github.swaince.controller;

import com.github.swaince.dto.StandardResponse;
import com.github.swaince.model.SystemDictionary;
import com.github.swaince.service.SystemDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @date: 2021/7/6 11:00
 * @author: zhangth
 * @description:
 */
@RestController
@RequestMapping("/dictionaries")
public class SystemDictionaryController {

    @Autowired
    private SystemDictionaryService systemDictionaryService;

    @GetMapping("/{id}")
    public StandardResponse getById(@PathVariable("id") Integer id) {
        StandardResponse response = new StandardResponse();
        SystemDictionary dictionary = systemDictionaryService.getById(id);
        response.setData(dictionary);
        return response;
    }
}
